package com.tumblr.logico2012.gestures;


/**
 * All gesture implementation must provide this interface.
 */
public interface IGesture {
	public static final int RIGHT = 0;
	public static final int LEFT = 1;
	public static final int UP = 2;
	public static final int DOWN = 3;
	
	/**
	 * Each gesture must be associated to a user. Return the user for this gesture. 
	 * @return User id
	 */
	public int getUserId();
	/**
	 * A gesture can be associated with an icon. getIcon returns the name of the icon, not the picture
	 * itself. The icon must be registered with the gesture manager.
	 * @return
	 */
	public String getIcon();
	/**
	 * Specify if the icon should be highlighted when the gesture is activated.
	 * @return
	 */
	public boolean showBorderOnSelect();
	/**
	 * Has the gesture been initialized? 
	 * @return State
	 */
	public boolean isInit();
	/**
	 * Is the gesture active? (currently being performed)
	 * @return State
	 */
	public boolean isActive();
	/**
	 * Initialise the gesture.
	 * Typically, a gesture implementation will activate specific "listeners" of the gesture manager.
	 * @param manager Gesture Manager
	 */
	public void init(GestureManager manager);
	/**
	 * Set refractory time.
	 * A gesture implementation is expected to set the refractory time for relevant "listeners" of the gesture manager.
	 * @param manager Gesture Manager
	 */
	public void setRefractory(GestureManager manager);
	/**
	 * Check if a start event should be triggered for this gesture.
	 * @param manager Gesture Manager
	 * @return True/False
	 */
	public boolean checkForStartEvent(GestureManager manager);
	/**
	 * Check if a stop event should be triggered for this gesture.
	 * @param manager Gesture Manager
	 * @return True/False
	 */
	public boolean checkForStopEvent(GestureManager manager);
	/**
	 * Check if the gesture has been interrupted abruptly (the stop event gestureAborted will be triggered) 
	 * or normally (the stop event gestureEnded will be triggered).
	 * @param manager Gesture Manager
	 * @return True/False
	 */
	public boolean isAborted(GestureManager manager);
	/**
	 * Event: The gesture has started 
	 * @param manager Gesture Manager
	 */
	public void gestureStarted(GestureManager manager);
	/**
	 * Event: The gesture has ended (performed completely) 
	 * @param manager Gesture Manager
	 */
	public void gestureEnded(GestureManager manager);
	/**
	 * Event: The gesture has ended (performed partially) 
	 * @param manager Gesture Manager
	 */
	public void gestureAborted(GestureManager manager);
}
